package org.example.abstract_factory;

/**
 * @author Zhang Yu
 * @description: 提供一个创建一系列相关或相互依赖对象的接口，而无需指定它们具体的类。
 * @date 2024/5/17 9:23
 */
public class Test {
    public static void main(String[] args) {
        AbstractFactory factory = AbstractFactory.createFactory("fast");
        /**
         * sout:
         * FastHtmlDocument path = C://
         * FastHtmlDocument save called
         * FastWordDocument path = C://
         * FastWordDocument save called
         */
//        AbstractFactory factory = AbstractFactory.createFactory("good");
        /**
         * sout:
         * GoodHtmlDocument path = C://
         * GoodHtmlDocument save called
         * GoodWordDocument path = C://
         * GoodWordDocument save called
         */
        String path = "C://";
        HtmlDocument html = factory.createHtml(path);
        html.save(path);
        WordDocument word = factory.createWord(path);
        word.save(path);
    }

}
